<template>
	<!-- 我的足迹 -->
	<view>
		<u-navbar title="我的足迹" @rightClick="rightClick" :autoBack="true" :safeAreaInsetTop="true" :placeholder="true" :fixed="true" :rightText="top_right"></u-navbar>
		<view class="list" v-for="(item,index) in list" :key="index">
			<view class="list_time">
				{{item.date}}
			</view>
			<view class="list_view">
				<view class="list_view_item flex" v-for="(ite,indexs) in item.items" :key="indexs">
					<image :src="ImgUrl + ite.article.img" class="list_view_item_img" mode=""></image>
					<view class="list_view_item_right">
						<!-- <view class="list_view_item_right_top"> -->
							{{ite.article.title}}
						<!-- </view> -->
						<!-- <view class="list_item_right_bottom_left">
							{{ite.article.integral}}
							<text class="list_item_right_bottom_left_text22">积分</text>
							+{{ite.article.price}}
							<text class="list_item_right_bottom_left_text22">元</text>
						</view> -->
					</view>
				</view>
			</view>
		</view>
		<u-empty mode="data" class="empty" v-if="list.length == 0"></u-empty>
	</view>
</template>

<script>
	import { trace, traceClear } from '../../api/common.js';
export default {
	data() {
		return {
			top_right:'全部清空',
			list:[]
		};
	},
	onShow() {
		this.getList();
	},
	computed:{
		ImgUrl(){
			console.log(this.$store.state.ImgUrl)
			return this.$store.state.ImgUrl
		},
	},
	methods: {
		delet(){
			traceClear().then(res=>{
				if(res.code == 200001){
					uni.showToast({
						title: '清除成功',
						icon: 'none'
					})
					this.getList();
				}
			})
		},
		getList(){
			trace().then(res=>{
				if(res.code == 200001){
					this.list = res.data;
				}
			})
		},
		rightClick(){
			this.delet();
		}
	}
};
</script>

<style>
	page{
		background: #F4F4F4;
	}
	.list_time{
		width: 100%;
		padding: 0 30rpx;
		height: 82rpx;
		box-sizing: border-box;
		line-height: 82rpx;
	}
	.list_view{
		width: 100%;
	}
	.list_view_item{
		width: 750rpx;
		padding: 30rpx;
		box-sizing: border-box;
		background: #FFF;
		border-radius: 8rpx;
		border-bottom: 1rpx solid #F4F4F4;
	}
	.list_view_item_right{
		width: 474rpx;
		height: 120rpx;
		/* display: flex;
		flex-direction: column;
		justify-content: space-between; */
		display: -webkit-box;
		-webkit-line-clamp: 3; /* 显示行数 */
		-webkit-box-orient: vertical;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.list_view_item_img{
		width: 176rpx;
		height: 176rpx;
		border-radius: 12rpx;
		background: #ccc;
	}
	.list_view_item_right_top{
		color: #262626;
		font-family: Source Han Sans CN;
		font-size: 24rpx;
		font-weight: 400;
		width: 90%;
		height: 176rpx;
	}
	.list_item_right_bottom_left {
		color: #dd504a;
		font-family: Alibaba PuHuiTi 2;
		font-size: 28rpx;
		font-weight: 400;
	}
	.list_item_right_bottom_left_text22 {
		font-size: 22rpx;
	}
	.empty{
		margin-top: 300rpx !important;
	}
	/deep/.u-navbar__content{
		width: 570rpx !important;
	}
	/deep/.u-navbar--fixed{
		background: #fff !important;
	}
</style>
